<?
@ session_start();

include_once("class.lib/db.class.php");
include_once("class.lib/user.class.php");
include_once("class.lib/diplome.class.php");
include_once("class.lib/cours.class.php");
include_once("class.lib/domaine.class.php");
include_once("class.lib/mention.class.php");
include_once("class.lib/niveau.class.php");
include_once("class.lib/aa_projet.class.php");

$cin=$_SESSION["cin"];
if($cin=="") { header("Location: ../index.php");   }

$unite = new Projet();
$details_unite = $unite->getProjetCode($_GET['id_ue']);



while (list($clef,$valeur)=each($details_unite))
{  

 
 $libelle      = $valeur[1];
 $nature       = $valeur[2];
 $semestre     = $valeur[9];
 $volume_cours  = $valeur[4];
 $volum_td     = $valeur[6];
 $volum_tp     = $valeur[5];
 $coeifficient = $valeur[7];
 $credit       = $valeur[12];


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Soumisison du cours</title>



<script language="JavaScript">
//PLF-http://www.jejavascript.net/
function OuvrirPop(url,nom,haut,Gauche,largeur,hauteur,options) {
ouvpop=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}
</script>
<script type="text/javascript" src="javascript.js"></script>

<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
<script type="text/javascript" src="fabtabulous.js"></script>
<script type="text/javascript" src="validation.js"></script>

<link href="presse.css" rel="stylesheet" type="text/css" />

</head>
<body bgcolor="DFE8F6">

<!--table width="677" height="575" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="DFE8F6">
    <tr>
    	<td--><H1><font color="DD0269">Modification de cours</font></H1><br/>
   <p><u> 
<!--H1>Information(s) concernant le dipl&ocirc;me et l'unit&eacute; d'enseignement:</p> <br />
</H1-->
</u> 
<table width="90" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="DFE8F6">
  <tr> 
    
    <td><a href="modif_cours.php?id_ue=<?     echo $_GET['id_ue'];?>"><img src="images/etape1_off.jpg"   width="90" height="20" border="0"/></a></td>
    <td><img src="images/etape2_on.jpg"  width="90" height="20" border="0"/></td>
	<td><a href="modif_indexation.php?id_ue=<? echo $_GET['id_ue'];?>"><img src="images/etape3_off.jpg" width="90" height="20" border="0"/></a></td>
    <td><a href="partenaire.php?id_ue=<? echo $_GET['id_ue'];?>"><img src="images/etape4_off.jpg" width="90" height="20" border="0"/></a></td>
  </tr>
</table>
<u>
<H1>&nbsp; </H1>
</u> 
<table width="481" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="DFE8F6">
  <tr> 
      <td width="481" align="left"> <p><strong><font color="DD0269">NB</font></strong>: Veuillez 
        v&eacute;rifier toutes les informations avant de valider le formulaire.<br />
        <br />
      </p>
      </td>
    </tr>
    <tr> 
      
    <td align="left">&nbsp; </td>
    </tr>
    <tr>
      <td> 
        <table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr align="left"> 
          <td width="480" height="50"><em><font color="#277BB0"><strong> </strong></font></em> 
            
        <form name="cours" id="cours" method="post" action="">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr align="left"> 
                  <td height="13" colspan="3"><strong><img src="images/navi_arerow.gif" width="6" height="21" align="absmiddle" /> 
                    Informations sur l'unit&eacute; d'enseignement :</strong></td>
                </tr>
                <tr valign="top" bgcolor="#345491"> 
                  <td colspan="3"><img src="images/gif/pix.gif" width="1" height="1"></td>
                </tr>
                <tr align="left"> 
                  <td width="242" height="12"><span class="Style5"><a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("ue.html","fencent",10,10,420,380,"menubar=no,scrollbars=no,statusbar=no")' /></a></span> 
                    <span class="Style5"><font color="DD0269">*</font></span> 
                     Intitul&eacute; de l'Unit&eacute; d&#8217;enseignement (UE)</td>
                  <td width="7" height="12">:</td>
                  <td width="231" height="12" class="required_info" id="unite_enseignement_zone"> <input name="libelle" type="text" id="libelle" value="<? echo $libelle; ?>" class="required" title="Veuillez entrer l'unit� SVP!!" /> 
                  </td>
                </tr>
                <tr align="left"> 
                  <td height="40"><span class="Style5"><a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("nature_ue.html","fencent",10,10,420,380,"menubar=no,scrollbars=yes,statusbar=no")' /></a></span> 
                    <span class="Style5"><font color="DD0269">*</font></span> 
                    Nature de l&#8217; &laquo; UE &raquo;</td>
                  <td height="25">:</td>
                  <td height="25" class="required_info"> 
                    <!--select name="nature_ue" id="nature_ue" OnChange="sendData('id='+this.value,'unite_ue.php','unite_enseignement_zone')" onKeyUp="sendData('id='+this.value,'unite_ue.php','unite_enseignement_zone')"-->
                    <select name="nature" id="nature" class="validate-selection" title="Veuillez selectionner la nature de l'UE SVP!">
                      <option value="0"> Nature de l'UE</option>
                      <option value="UE FONDAMENTALE" <? if($nature=="UE FONDAMENTALE") echo "selected=\"selected\""; ?>>UE fondamentale</option>
                      <option value="UE TRANSFERSALE" <? if($nature=="UE TRANSFERSALE") echo "selected=\"selected\""; ?>>UE transversale</option>
                      <option value="UE OPTIONNELE"   <? if($nature=="UE OPTIONNELE")   echo "selected=\"selected\""; ?>>UE optionnelle </option>
                    </select></td>
                </tr>
                <!--tr align="left"> 
                  <td height="25"><span class="Style5"><a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("ecue.html","fencent",10,10,420,380,"menubar=no,scrollbars=yes,statusbar=no")' /></a></span> 
                    <span class="Style5"><font color="DD0269">*</font></span> 
                    El&eacute;ment Constitutif de l&#8217;UE (ECUE)</td>
                  <td height="25">:</td>
                  <td height="25" class="required_info"><input name="ecue" type="text" id="ecue" class="required" title="Veuillez entrer l'�l�ment consititutif SVP!!"/></td>
                </tr-->
            <!--    <tr align="left"> 
                  <td height="25"><span class="Style5"><font color="DD0269">*</font></span> 
                    Semestre</td>
                  <td height="25">:</td>
                  <td height="25" class="required_info"> 
				  <select name="semestre" id="semestre" class="validate-selection" title="Veuillez selectionner un semestre SVP!">
                      <option value="0"> choisissez le semestre</option>
                      <?php for($i=1; $i<=6; $i++){
					        
							if($i==1) $sems="1 er semestre";
							else      $sems="%s &eacute;me semestre";
							
							$val = "S".$i;
					  ?>
                      <option value="<?=$val?>" <? if($val == $semestre) echo "selected=\"selected\""; ?>><? printf($sems, $i);?></option>
                      <?php } ?>
                    </select> 
				  </td>
                </tr>
                <tr align="left"> 
                  <td height="25" colspan="3"><span class="Style5">*</span> 
                    Volume horaire (nombre d&#8217;heure par semestre):</td>
                </tr>
                <tr align="left"> 
                  <td height="25">&nbsp;</td>
                  <td height="25">&nbsp;</td>
                  <td height="25" class="required_info"><b>Cours:</b> 
				  
				  
				  
				  
				  <select name="volum_cours" id="volum_cours" style="width:50px">
                      
                      <?php for($i=0; $i<=100; $i++){
					        
													
							$val = $i;
							$val2 = $i.".5";
					  ?>
                      <option value="<?=$val?>"   <? if($val == $volume_cours) echo "selected=\"selected\""; ?>><? echo $val;?></option>
					  <option value="<?=$val2?>" <? if($val2 == $volume_cours) echo "selected=\"selected\""; ?>><? echo $val2;?></option>
                      <?php } ?>
                    </select> 
				  
				  <span class="Style7"><span class="Style8"><b>TD:</b> 
                     
					 
					 
					 <select name="volum_td" id="volum_td" style="width:50px">
                      
                      <?php for($i=0; $i<=100; $i++){
					        
													
							$val = $i;
							$val2 = $i.".5";
					  ?>
                      <option value="<?=$val?>"   <? if($val == $volum_td) echo "selected=\"selected\""; ?>><? echo $val;?></option>
					  <option value="<?=$val2?>" <? if($val2 == $volum_td) echo "selected=\"selected\""; ?>><? echo $val2;?></option>
                      <?php } ?>
                    </select> 
					 
					 
                                        <b>TP:</b> <span class="Style7"> 
                    <select name="volum_tp" id="volum_tp" style="width:50px">
                      
                      <?php for($i=0; $i<=100; $i++){
					        
													
							$val = $i;
							$val2 = $i.".5";
					  ?>
                      <option value="<?=$val?>"   <? if($val == $volum_tp) echo "selected=\"selected\""; ?>><? echo $val;?></option>
					  <option value="<?=$val2?>" <? if($val2 == $volum_tp) echo "selected=\"selected\""; ?>><? echo $val2;?></option>
                      <?php } ?>
                    </select> 
					 
					    </span></span></span></td>
                </tr>
                <tr align="left"> 
                  <td height="12">Coefficient </td>
                  <td height="12">:</td>
                  <td height="12" class="required_info">
                  	
				
					<select name="coeifficient" id="coeifficient">
                      
                      <?php for($i=1;$i<=10;$i++){
					        
							
					  ?>
                      <option value="<?=$i?>" <? if($i == $coeifficient) echo "selected=\"selected\""; ?>><? echo $i;?></option>
                      <?php } ?>
                    </select> 
					
				
					</td>
                </tr>
                <tr align="left"> 
                  <td height="25">Cr&eacute;dits (ECTS)</td>
                  <td height="25">:</td>
                  <td height="25" class="required_info"> 

				<select name="credit" id="credit">
                      
                      <?php for($i=1;$i<=30;$i++){
						
					  ?>
                      <option value="<?=$i?>" <? if($i == $credit) echo "selected=\"selected\""; ?>><? echo $i." ECTS";?></option>
                      <?php } ?>
                    </select>
					
					</td>
                </tr>
				-->
				
				<tr> 
                  <td height="25" align="left">&nbsp;</td>
                  <td height="25">&nbsp;</td>
                  <td height="25" align="left"> <input type="reset" name="Submit22" value="R&eacute;tablir" class="button" /> 
                    <input type="submit" name="Submit4" value="valider" class="button" /> 
					<!--input type="submit" name="Submit41" value="Continuer plus tard" class="button" /--> 
                  </td>
                </tr>
				
				
                <tr align="left"> 
                  <td height="25">&nbsp;</td>
                  <td height="25">&nbsp;</td>
                  <td height="25">
                  <input name="modif_unite" type="hidden" id="modif_unite" value="OK" />
				  <input name="id_ue" type="hidden" id="id_ue" value="<? echo $_GET['id_ue']; ?>" /> 
                     
                    
                  </td>
                </tr>
                
              </table>
            </form>
	       <script type="text/javascript">
		       var valid2 = new Validation('cours', {useTitles:true});
	       </script>
		
      </td>
    </tr>
    <tr>
	
      
    <td align="left"><span class="Style5"><font color="DD0269">*</font></span> 
      <font color="DD0269"><em><strong>Champs obligatoire</strong></em></font></td>
    </tr>
  </table>
  </td>
    </tr>
</table>
<!--/td></tr>

</table-->

<p> 
  <?
}

 if(!empty($_POST['modif_unite']))
{
	$ue_tab['libelle']     = $_POST["libelle"];
	$ue_tab['nature']      = $_POST["nature"];
	$ue_tab['semestre']    = $_POST["semestre"];
	$ue_tab['volum_cours'] = $_POST["volum_cours"];
	$ue_tab['volum_td']    = $_POST["volum_td"];
	$ue_tab['volum_tp']    = $_POST["volum_tp"];
	$ue_tab['coeifficient'] = $_POST["coeifficient"];
	$ue_tab['credit']      = $_POST["credit"];
	
	$ue_tab['code_ue']     = $_POST["id_ue"];
	
    $modif = $unite->updateDipInfos2($ue_tab);
	
	
	//On actualise la page
	echo "<script language=\"JavaScript\"> document.location=\"modif_indexation.php?id_ue=".$_POST['id_ue']."\"; </script>;";
	} 

  
?>
</p>
</body>
</html>
